package com.dly.blog.exception;

import com.dly.blog.content.ExceptionContent;
import lombok.Getter;

/**
 * @Author: DaiLiYu
 * @Date: 2023/7/11 22:29
 */
@Getter
public enum FileExceptionEnum {

    FILE_EXCEPTION_ENUM(new FileException(ExceptionContent.FileException + 1, "文件异常")),

    FILE_UPLOAD_ERROR(new FileException(ExceptionContent.FileException + 2, "文件上传失败")),

    NOT_SUPPORTED_FILE_UPLOAD(new FileException(ExceptionContent.FileException + 3, "不支持的文件上传类型")),

    FILE_NOT_EXIT(new FileException(ExceptionContent.FileException + 4, "文件不存在")),

    FILE_EXPIRATION(new FileException(ExceptionContent.FileException + 5, "文件过期时间不存在")),

    FILE_OVERDUE(new FileException(ExceptionContent.FileException + 6, "文件已过期"))
    ;

    FileExceptionEnum(FileException fileException){
        this.fileException = fileException;
    }

    private final FileException fileException;

    public static class FileException extends GlobalException{

        private static final String MODULE = "File";

        public FileException(int code, String message) {
            super(code, message, MODULE);
        }
    }
}
